#!/usr/bin/env sh

./gradlew clean build publish --no-daemon --no-parallel && \

if ! grep -q -- "VERSION_NAME=.*-SNAPSHOT" gradle.properties;
then
./gradlew closeAndReleaseRepository
else
echo "Nothing else to do for a snapshot"
fi
